package com.masterclient.app.modules.order.utils;

import android.text.TextUtils;

import com.eoner.baselibrary.bean.address.AddressBean;
import com.eoner.baselibrary.bean.address.AddressMessage;
import com.eoner.baselibrary.bean.order.CustomsClearanceMessage;
import com.masterclient.app.businessmodule.settingmodule.crossborder.model.CrossBorderUserMessage;

public class ModelAdapterUtil {

    public static AddressMessage addressMessageConvert(AddressBean.DataBean.ShItemsBean itemsBean){
        AddressMessage addressMessage = null;
        if (itemsBean != null && !TextUtils.isEmpty(itemsBean.getSh_address())) {
            addressMessage = new AddressMessage();
            addressMessage.setAddress(itemsBean.getSh_address());
            addressMessage.setAddress_id(itemsBean.getSh_id());
            addressMessage.setArea(itemsBean.getSh_area());
            addressMessage.setCity(itemsBean.getSh_city());
            addressMessage.setFull_name(itemsBean.getSh_full_name());
            addressMessage.setIs_default(itemsBean.getSh_is_default());
            addressMessage.setMobile(itemsBean.getSh_mobile());
            addressMessage.setProvince(itemsBean.getSh_province());
        }
        return addressMessage;
    }

    public static CustomsClearanceMessage customsClearanceMessageConvert(CrossBorderUserMessage cross_border_user_message){
        CustomsClearanceMessage customsClearanceMessage = null;
        if (cross_border_user_message != null && !TextUtils.isEmpty(cross_border_user_message.getSh_real_name())) {
            customsClearanceMessage = new CustomsClearanceMessage();
            customsClearanceMessage.setAddress(cross_border_user_message.getSh_address());
            customsClearanceMessage.setBirthday(cross_border_user_message.getSh_birthday());
            customsClearanceMessage.setClearance_id(cross_border_user_message.getSh_id());
            customsClearanceMessage.setIdentity_card(cross_border_user_message.getSh_identity_card());
            customsClearanceMessage.setIs_default(cross_border_user_message.getSh_is_default());
            customsClearanceMessage.setNation(cross_border_user_message.getSh_nation());
            customsClearanceMessage.setReal_name(cross_border_user_message.getSh_real_name());
        }
        return customsClearanceMessage;
    }
}
